package com.example.pattern.observer.demo01;

public class ObserverTest {

    public static void main(String[] args) {
        GPer gPer = GPer.getInstance();
        Teacher tom = new Teacher("Tom");
        Teacher mic = new Teacher("Mic");

        gPer.addObserver(tom);
        gPer.addObserver(mic);

        Question question = new Question();
        question.setUsername("王子");
        question.setContent("花儿为什么这样红？");

        gPer.publishQuestion(question);
    }
}
